package cn.easytogo.tag;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.TagSupport;

public class BaseTag extends TagSupport
{

    public BaseTag()
    {
    }

    public int doStartTag()
        throws JspException
    {
        StringBuffer stringbuffer = new StringBuffer(500);
        String s = ((HttpServletRequest)pageContext.getRequest()).getContextPath();
        String s1 = pageContext.getRequest().getScheme() + "://" + pageContext.getRequest().getServerName() + ":" + pageContext.getRequest().getServerPort() + s + "/";
        stringbuffer.append("<script type=\"text/javascript\">var easytogo_basepath = \"" + s1 + "\";");
        stringbuffer.append("</script>\n");
        stringbuffer.append("<script type=\"text/javascript\" src=\"" + s1 + "easytogo/js/jquery.js\"></script>\n");
        stringbuffer.append("<script type=\"text/javascript\" src=\"" + s1 + "easytogo/js/json2.js\"></script>\n");
        stringbuffer.append("<script type=\"text/javascript\" src=\"" + s1 + "easytogo/js/utils.js\"></script>\n");
        stringbuffer.append("<script type=\"text/javascript\" src=\"" + s1 + "easytogo/ui/VSObjsMgr.js\"></script>\n");
        try {
			pageContext.getOut().write(stringbuffer.toString());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        return super.doStartTag();
    }
}